home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Utilities Experience
/
The Utilities Experience - Volume 1.iso
/
software
/
comms
/
thor_2.22
/
thor.lha
/
rexx
/
StealTagline.thor
< prev
next >
Wrap
Text File
|
1995-12-18
|
2KB
|
80 lines
/*
** $VER: 1.5 (17.2.95)
**
** StealTagline.thor
**
** Steals taglines from the current message
**
** Author: Magne Østlyngen
**
** (C)1994-1995 Ultima Thule Software
*/
options results
p=address()||' '||show('P',,);if pos('THOR.',p)>0 then thorport=word(,
substr(p,pos('THOR.',p)),1);else do;say 'No THOR port found!';exit 10;end
if ~show('p','BBSREAD') then do;address command;
"run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead";"WaitForPort BBSREAD";end
address(thorport)
CURRENTMSG STEM msg
if rc~=0 then error('"CURRENTMSG failed: '||THOR.LASTERROR||'"')
address BBSREAD
READBRMESSAGE '"'||msg.bbsname||'"' '"'||msg.confname||'"' msg.msgnr HEADSTEM head TEXTSTEM text
if rc~=0 then error('"READBRMESSAGE failed: '||BBSREAD.LASTERROR||'"')
drop txt.
n=text.text.count
do while text.text.n="";n=n-1;end
text.text.count=n
nl=0;do n=1 to text.text.count;if text.text.n=""then nl=n;end
txt.count=text.text.count-nl
n=1;do i=nl+1 to text.text.count;txt.n=text.text.i;n=n+1;end
address(thorport)
drop out.
REQUESTLIST txt out '"Select lines to steal"' DRAGSELECT SIZEGADGET
if rc=5 then exit
if rc~=0 then error('"REQUESTLIST failed: '||THOR.LASTERROR||'"')
if out.count=0 then exit
address BBSREAD
GETCONFDATA '"'||msg.bbsname||'" "'||msg.confname||'"' conf
if rc~=0 then error('"GETCONFDATA failed: '||BBSREAD.LASTERROR||'"')
tagf=conf.tagfile
if(symbol("conf.tagfile")~="VAR")|(conf.tagfile="")then do
GETBBSDATA '"'||msg.bbsname||'"' bbs
if rc~=0 then error('"GETBBSDATA failed: '||BBSREAD.LASTERROR||'"')
tagf=bbs.tagfile
if(symbol("bbs.tagfile")~="VAR")|(bbs.tagfile="")then do
GETGLOBALDATA glob
if rc~=0 then error('"GETGLOBALDATA failed: '||BBSREAD.LASTERROR||'"')
tagf=glob.tagfile
if(symbol("glob.tagfile")~="VAR")|(glob.tagfile="")then error('"No tagfile configured"')
end
end
address command "echo noline >>"||tagf
if ~open(fil,tagf,A)then error('"Couldn'||"'"||'t open tagfile to append new tag"')
tagline=""
do n=1 to out.count
tagline=tagline||out.n
if n~=out.count then tagline=tagline||'\n'
end
call writeln(fil,tagline)
call close(fil)
exit
error:
parse arg err
address(thorport)
say REQUESTNOTIFY err '"_Ok"'
REQUESTNOTIFY err '"_Ok"'
exit